]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
environment: Reimplement Date.toLocaleFormat() override
authorFlorian Müllner <fmuellner@gnome.org>
Tue, 10 Sep 2019 03:10:01 +0000 (05:10 +0200)
committerGeorges Basile Stavracas Neto <georges.stavracas@gmail.com>
Wed, 6 Nov 2019 20:19:57 +0000 (20:19 +0000)
Now that we no longer go through GTimeVal to convert from Date to
GDateTime, there is no more reason for using a C helper function.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/807

js/ui/environment.js

index 4b330e5da5bb8ca55277aaf777e736554dca191d..715aca31d26b05e012c88996a4a5efea5a2968c2 100644 (file)
@@ -292,7 +292,8 @@ function init() {
 
     // Work around https://bugzilla.mozilla.org/show_bug.cgi?id=508783
     Date.prototype.toLocaleFormat = function(format) {
-        return Shell.util_format_date(format, this.getTime());
+        let dt = GLib.DateTime.new_from_unix_local(this.getTime() / 1000);
+        return dt ? dt.format(format) : '';
     };
 
     let slowdownEnv = GLib.getenv('GNOME_SHELL_SLOWDOWN_FACTOR');